package com.ice.delay.task.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ice.delay.task.core.model.DelayTaskDetail;
import com.ice.delay.task.vo.req.DelayTaskDetailVoReq;
import com.ice.delay.task.vo.res.DelayTaskDetailVoRes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DelayTaskDetailDao extends BaseMapper<DelayTaskDetail> {

    List<DelayTaskDetail> scheduleTaskQuery(@Param("maxNextTime") long maxNextTime);

    /**
     * 查询运行中的任务或者是超过了当前执行时间的任务
     * @return
     */
    List<DelayTaskDetail> runingTaskQuery();

    int updateExecuteStatus(@Param("list") List<String> code, @Param("status") Integer status);

    IPage<DelayTaskDetailVoRes> pageDetail(@Param("page") IPage<DelayTaskDetailVoReq> iPage, @Param("bean") DelayTaskDetailVoReq parameter);
}